/* $RCSFile: ADNDynBulkdeleteoperation.cs $
 * Apache license v2 2011 by Christian Surieux
 * $Source: ?/CRMWrapper3/DynEntities/ADNDynBulkdeleteoperation.cs $
 * $log$
 * Revision 19 2010/10/02 14:01:48  christian.surieux
 *   Corrected a bug in allmost everyADNDyn file for PrimaryFieldVualue
 * Revision 6 2010/08/06 19:56:32  christian.surieux
 *   Added Log to All cs files
 */

/* Copyrights Christian Surieux 2010 */
/* Class ADNDynBulkdeleteoperation */
/* Date 2010-01-06 16:02:32Z */

using System;
using System.Diagnostics;
using System.Collections;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using CrmSdk;

namespace AddonNice.CRMWrapper
{
	public class ADNDynBulkdeleteoperation : DynEntity
	{
        protected class Ftor: DFactor
        {
            public Ftor() : base(CrmStr.bulkdeleteoperation)
            {}

            public override Type DynType
            { get { return typeof(ADNDynBulkdeleteoperation); } }

            public override string DynTypename
            { get { return CrmStr.bulkdeleteoperation; } }

            public override DynEntity Build()
            {   return new ADNDynBulkdeleteoperation();}

            public override DynEntity Build(CRMWrapperBase w, InternalDynamicEntity dEntity, PropertyDescriptorCollection wproperties)
            {   return new ADNDynBulkdeleteoperation(w, dEntity, wproperties, null);}

            public override DynEntity Build(CRMWrapperBase w, string PrimaryFieldValue)
            {   return new ADNDynBulkdeleteoperation(w,PrimaryFieldValue);}

            public override DynEntity Build(CRMWrapperBase w,Guid PrimaryKeyValue)
            {   return new ADNDynBulkdeleteoperation(w,PrimaryKeyValue);}
        }

        static ADNDynBulkdeleteoperation(){new Ftor();} 
        
        public override bool HasOwnerProperty
        {
            get { return false; }
        }
        
        public override bool HasOwningBusinessUnitProperty
        { get { return true; } }
        
        public ADNDynBulkdeleteoperation() : base() { }
        
        public ADNDynBulkdeleteoperation(CRMWrapperBase w,string PrimaryFieldValue)
            : base(w,CrmStr.bulkdeleteoperation)
        {
            if ( PrimaryFieldValue != string.Empty )
                name = PrimaryFieldValue;
        }
        
        public ADNDynBulkdeleteoperation(CRMWrapperBase w,Guid CrmId) : base(w,CrmStr.bulkdeleteoperation,CrmId) { }
        
        public ADNDynBulkdeleteoperation(CRMWrapperBase w,InternalDynamicEntity e) : base(w,CrmStr.bulkdeleteoperation,e,null,null) { }
        
        public ADNDynBulkdeleteoperation(CRMWrapperBase w,InternalDynamicEntity e,PropertyDescriptorCollection prop,InternalColumnSet s) : base(w,CrmStr.bulkdeleteoperation,e,prop,s) { }
        
        public ADNDynBulkdeleteoperation(ResetWrapperHandler fn,string PrimaryFieldValue)
            : base(fn,CrmStr.bulkdeleteoperation)
        {
            if ( PrimaryFieldValue != string.Empty )
                name = PrimaryFieldValue;
        }
        
        public ADNDynBulkdeleteoperation(ResetWrapperHandler fn,Guid CrmId) : base(fn,CrmStr.bulkdeleteoperation,CrmId) { }
        
        public ADNDynBulkdeleteoperation(ResetWrapperHandler fn,InternalDynamicEntity e) : base(fn,CrmStr.bulkdeleteoperation,e,null,null) { }
        
        public ADNDynBulkdeleteoperation(ResetWrapperHandler fn,InternalDynamicEntity e,PropertyDescriptorCollection prop,InternalColumnSet s) : base(fn,CrmStr.bulkdeleteoperation,e,prop,s) { }

        /* Properties */

        [CrmDynAttribute(CrmStr.bulkdeleteoperation)]
        public Guid bulkdeleteoperationid
        {
            get
            { return KeyPropertyValue(CrmStr.bulkdeleteoperationid); }
            set
            { AddKeyProperty(CrmStr.bulkdeleteoperationid,value); }
        }

        protected override void SetCrmIdProperty(Guid crmId)
        {
            if ( !dicProperty.ContainsKey(CrmStr.bulkdeleteoperationid) || KeyPropertyValue(CrmStr.bulkdeleteoperationid) != crmId )
                bulkdeleteoperationid = crmId;
        }
        public override Guid PrimaryKeyGuidValue
        {
            get
            { return bulkdeleteoperationid; }
            set { bulkdeleteoperationid = value; }
        }
        
        public override string PrimaryFieldName
        {
            get
            { return CrmStr.name; }
            set
            {}
        }

        public override string PrimaryFieldStringValue
        {
            get
            {
                return name;
            }
            set
            {
                name =   value;
            }
        }

        [CrmDynAttribute(CrmStr.bulkdeleteoperation)]
        public Guid asyncoperationid
        {
            get
            { return LookupPropertyValue(CrmStr.asyncoperationid); }
            set
            { AddLookupProperty(CrmStr.asyncoperationid,"CrmStr.xxx",value); }
        }

        public string asyncoperationName
        {
            get
            { return LookupPropertyName(CrmStr.asyncoperationid); }
        }

        [CrmDynAttribute(CrmStr.bulkdeleteoperation)]
        public int failurecount
        {
            get
            { return NumberPropertyValue(CrmStr.failurecount); }
            set
            { AddNumberProperty(CrmStr.failurecount,value); }
        }

        [CrmDynAttribute(CrmStr.bulkdeleteoperation)]
        public bool isrecurring
        {
            get
            { return BooleanPropertyValue(CrmStr.isrecurring); }
            set
            { AddBooleanProperty(CrmStr.isrecurring,value); }
        }

        [CrmDynAttribute(CrmStr.bulkdeleteoperation)]
        public override string name
        {
            get
            { return StringPropertyValue(CrmStr.name); }
            set
            { AddStringProperty(CrmStr.name,value); }
        }

        [CrmDynAttribute(CrmStr.bulkdeleteoperation)]
        public string nextrun
        {
            get
            { return DateTimePropertyValue(CrmStr.nextrun); }
            set
            { AddDateTimeProperty(CrmStr.nextrun,value); }
        }

        [CrmDynAttribute(CrmStr.bulkdeleteoperation)]
        public string orderedquerysetxml
        {
            get
            { return StringPropertyValue(CrmStr.orderedquerysetxml); }
            set
            { AddStringProperty(CrmStr.orderedquerysetxml,value); }
        }

        [CrmDynAttribute(CrmStr.bulkdeleteoperation)]
        public Guid owningbusinessunit
        {
            get
            { return LookupPropertyValue(CrmStr.owningbusinessunit); }
            set
            { AddLookupProperty(CrmStr.owningbusinessunit,CrmStr.businessunit,value); }
        }

        [CrmDynAttribute(CrmStr.bulkdeleteoperation)]
        public Guid owninguser
        {
            get
            { return LookupPropertyValue(CrmStr.owninguser); }
            set
            { AddLookupProperty(CrmStr.owninguser,CrmStr.systemuser,value); }
        }

        [CrmDynAttribute(CrmStr.bulkdeleteoperation)]
        public int processingqeindex
        {
            get
            { return NumberPropertyValue(CrmStr.processingqeindex); }
            set
            { AddNumberProperty(CrmStr.processingqeindex,value); }
        }

        [CrmDynAttribute(CrmStr.bulkdeleteoperation)]
        public int successcount
        {
            get
            { return NumberPropertyValue(CrmStr.successcount); }
            set
            { AddNumberProperty(CrmStr.successcount,value); }
        }
    }
}